﻿using System;

namespace StoCombatLogHUD.Toolkit.ExtensionMethods
{
	/// <summary>
	/// Usefull extensions for any objects.
	/// </summary>
	public static class ObjectExtensions
	{
		/// <summary>
		/// Performs an action on the specified object and returns it.
		/// </summary>
		/// <typeparam name="TObject">The type of the object.</typeparam>
		/// <param name="obj">The obj.</param>
		/// <param name="action">The action.</param>
		/// <returns></returns>
		public static TObject Perform<TObject>(this TObject obj, Action<TObject> action)
		{
			action(obj);
			return obj;
		}
	}
}
